@using AyBorg.Web.Shared.Models

<MudDataGrid @ref="_table" Items="@EventEntries" SortMode="SortMode.Multiple"
            FilterMode="DataGridFilterMode.ColumnFilterRow"
            Filterable="true" Hideable="true" Hover="true" Elevation="0" ShowMenuIcon="true">
    <ToolBarContent>
        <MudText Typo="Typo.h6">Event Log</MudText>
        <MudSpacer />
        <MudTooltip Text="Download Log as CSV">
            <MudIconButton Icon="@Icons.Material.Filled.Download" OnClick="@DownloadLogAsCsv" Disabled="@IsLoading" />
        </MudTooltip>
    </ToolBarContent>
    <Columns>
        <PropertyColumn Property="x => x.Timestamp" Title="Timestamp (UTC)" CellStyleFunc="@_timestampCellStyleFunc"/>
        <PropertyColumn Property="x => x.LogLevel" Title="Level" />
        <PropertyColumn Property="x => x.ServiceUniqueName" Title="Service Name" />
        <PropertyColumn Property="x => x.EventName" Title="Event" />
        <PropertyColumn Property="x => x.Message" />
        <PropertyColumn Property="x => x.ServiceType" Title="Service Type" Hidden="true" Filterable="false" />
        <PropertyColumn Property="x => x.EventId" Title="Event ID" Hidden="true" Filterable="false" />
    </Columns>
</MudDataGrid>
